package cn.zn.wx.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IndexController {

    @RequestMapping("login")
    public void login() {
    }

    @RequestMapping("index")
    public void index() {
    }

    @RequestMapping("center")
    public void center() {
    }

    @RequestMapping("profile")
    public void profile() {
    }

    @RequestMapping("web/**")
    public void commonPage(ModelMap model, HttpServletRequest request) {
        String queryString = request.getQueryString();
        if(StrUtil.isNotBlank(queryString)){
            model.addAllAttributes(HttpUtil.decodeParamMap(queryString,"utf-8"));
        }
    }
}
